Plugged memory leak in gtk_style_finalize (destroy the ->background[] patterns).
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 16 Jan 2011 11:17:52 +0000 (20:17 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 16 Jan 2011 11:17:52 +0000 (20:17 +0900)
gtk/gtkstyle.c

index f9abf8d9c391e13dbf4da442003eaa2fe71f7551..9fd3bfbe6fce0700936f8b87481bf96591cf58f0 100644 (file)
@@ -513,6 +513,7 @@ gtk_style_finalize (GObject *object)
 {
   GtkStyle *style = GTK_STYLE (object);
   GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style);
+  gint i;
 
   g_return_if_fail (style->attach_count == 0);
 
@@ -559,6 +560,12 @@ gtk_style_finalize (GObject *object)
       g_object_unref (priv->context);
     }
 
+  for (i = 0; i < 5; i++)
+    {
+      if (style->background[i])
+        cairo_pattern_destroy (style->background[i]);
+    }
+
   G_OBJECT_CLASS (gtk_style_parent_class)->finalize (object);
 }